package Io;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class IoDemo5 {
    //字节流读取文件
    public static void main(String[] args) throws IOException {
        InputStream inputStream = new FileInputStream("d:/test.txt");
        while (true) {
            int res = inputStream.read();
            if (res == -1) {
                break;
            }
            //System.out.println((byte)res);
            System.out.printf("%x\n",(byte)res);
        }

        inputStream.close();
    }

}
